@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/createPro.css?v=1.0.6">
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.page.js?v=1.0.3"></script>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/justTools.js"></script>
    <script>
        //尺码工艺
        var craft_infos_new = [
                <?php $j = count($craft_infos);$i = 0; ?>
                @foreach ($craft_infos as $k=>$v )
            {"id":"{{$v->id}}","craft_name":"{{$v->craft_name}}"}<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
        //颜色
        var fabric_color = [
                <?php $j = count($color_pro);$i = 0; ?>
                @foreach ($color_pro as $k=>$v )
            {"color":"{{$v}}"}<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
    </script>
    <div class="container">
        <div class="row">
            <div style="margin:30px;"><h3 >BOM资料</h3></div>
            <div style="width:95%;margin-left:40px;">
                <div class="form-group"><h3 >基本信息</h3></div>
                <div class="form-group">
                    <ul class="form_ul">
                        <li class="form_li">版本号：<input style="background:none;border:none;border-bottom:1px solid #ccc;" class="form_inp" disabled value="{{$infos->bom}}" type="text" /></li>
                        <li class="form_li">款号：<input style="background:none;border:none;border-bottom:1px solid #ccc;" class="form_inp" disabled value="{{$infos->girard}}" type="text" /></li>
                        <li class="form_li">吊牌价：<input style="background:none;border:none;border-bottom:1px solid #ccc;" class="form_inp" disabled value="{{$infos->retail_price}}" type="text" /></li>
                    </ul>
                    <ul class="form_ul" style="height:105px;">
                        <li class="form_li" style="width:565px;">备注：
                            <textarea class="sel_inp mark" style="width:500px;height:100px;resize:none;">{{$infos->mark}}</textarea>
                        </li>
                    </ul>
                </div>
                <div class="form-group" style="height:30px;">
                    <h3 style="float:left;">面料信息</h3>
                    <a class="btn bt_a btn-primary addIns" href="javascript:;" style="float:left;margin-left:30px;" @if($pro_status==1) abc='1' @endif onclick="addlis()">添加</a>
                </div>
                <div class="form-group">
                    <div class="widget-main">
                        <div class="tabbable">
                            <ul class="nav nav-tabs" id="myTab11">
                                <li abc="1" class="lis active"><a id="curr" class="in" href="#directs">面料</a></li>
                                <li abc="2" class="lis"><a id="curr" href="#deputys">辅料</a></li>
                                <li abc="3" class="lis"><a id="curr" href="#rates">工艺</a></li>
                            </ul>
                            <div class="tab-content">
                                {{--面料--}}
                                <div id="directs" class="tab-pane fabric_div actives">
                                    <table class="fabric Onemian" abc="{{$infos->id}}" border="1" cellspacing="0" cellpadding="0">
                                        <thead>
                                        <tr>
                                            <td style="width:70px;">分类</td>
                                            <td style="width:75px;">大货颜色</td>
                                            <td style="width:200px;">供应商货号</td>
                                            <td style="width:75px;">面料色卡号</td>
                                            <td style='width:70px;'>成本价</td>
                                            <td style='width:70px;'>门幅</td>
                                            @if(count($infos->bom)>0 && count($infos->size)>0)
                                                <td style='width:70px;'>尺码</td>
                                                <?php $sizes=explode(',',$infos->size);?>
                                                @for($i=0;$i<count($sizes);$i++)
                                                    <td class="sits1" id="size">{{$sizes[$i]}}</td>
                                                @endfor
                                            @endif
                                            <td style="width:95px;" class="operateTit">操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>

                                        @if(count($fabric_infos)>0)
                                            <?php $infos_nums=1;?>
                                            @foreach($fabric_infos as $k => $v)
                                                @if($v->type=='main')
                                                    <tr>
                                                        <td>
                                                            <select class="sel_inp ips fabric_type1">
                                                                <option value="0">请选择</option>
                                                                @if($v->fabric_type)
                                                                    <option value="{{$v->fabric_type}}" selected>{{$v->fabric_type}}</option>
                                                                @endif
                                                                <option value="主面料">主面料</option>
                                                                <option value="里料">里料</option>
                                                                <option value="配料">配料</option>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <select class="sel_inp ips bigColor cloth_info1">
                                                                @if($v->other_info)
                                                                    <option value="{{$v->other_info}}">{{$v->other_info}}</option>
                                                                @endif
                                                                <option value="0">请选择</option>
                                                                @if(count($color_pro)>0)
                                                                    @for($i=0;$i<count($color_pro);$i++)
                                                                        <option value="{{$color_pro[$i]}}">{{$color_pro[$i]}}</option>
                                                                    @endfor
                                                                @endif
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input class="other_info1 form_inp ips codes cob{{$fabric_infos_num->main-$infos_nums}}" abc="1" type="text" autocomplete="off" autocorrect="off" gg="{{$v->cloth_id}}"
                                                                   value="@if($v->other_info){{$v->cloth_info}}@endif">
                                                        </td>
                                                        <td>
                                                            <select class="sel_inp ips atla1 color_define_id1">
                                                                @if(count($v->fabric_color))
                                                                    <?php $or_color=explode(',',$v->color_ids);?>
                                                                    @if($v->color_id != 0)
                                                                        @for($i=0;$i<count($v->fabric_color);$i++)
                                                                            <option value="{{$or_color[$i]}}" @if($colors[$v->color_id]== $v->fabric_color[$i])selected @endif>{{$v->fabric_color[$i]}}</option>
                                                                        @endfor
                                                                    @endif
                                                                @endif
                                                                <option value="0">请选择</option>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input class="cost_info1 form_inp ips" type="text" autocomplete="off" autocorrect="off" value="@if($v->cost!=0) {{$v->cost}}@endif">
                                                        </td>
                                                        <td>
                                                            <input class="door_info1 form_inp ips" type="text" autocomplete="off" autocorrect="off" value="@if($v->door!=0) {{$v->door}}@endif">
                                                        </td>
                                                        <td class="ttp1" abc="{{$fabric_infos_num->main-$infos_nums}}">用量/米</td>
                                                        @if(count($infos->bom)>0 && $v->remark)
                                                            <?php $size_=explode(',',$v->remark);?>
                                                            @for($i=0;$i<count($size_);$i++)
                                                                <td><input class="feis numC rek{{$fabric_infos_num->main-$infos_nums}}" type="text" value="{{$size_[$i]}}"></td>
                                                            @endfor
                                                        @endif
                                                        <td>
                                                            <a href="javascript:;" class="operateDe" abc="{{$v->id}}" def="1">删除</a>
                                                            <a href="javascript:;" class="copyTr" dd="1">复制</a>
                                                        </td>
                                                    </tr>
                                                    <?php $infos_nums++;?>
                                                @endif
                                            @endforeach
                                        @endif

                                        </tbody>
                                    </table>
                                </div>
                                {{--辅料--}}
                                <div id="deputys" class="tab-pane fabric_div">
                                    <table class="fabric Twofu" border="1" cellspacing="0" cellpadding="0">
                                        <thead>

                                        <tr>
                                            <td style="width:70px;">分类</td>
                                            <td style="width:75px;">大货颜色</td>
                                            <td style="width:120px;">供应商货号</td>
                                            <td style="width:75px;">面料色卡号</td>
                                            <td style='width:70px;'>成本价</td>
                                            <td style='width:70px;'>门幅</td>
                                            @if(count($infos->bom)>0 && count($infos->size)>0)
                                                <td style='width:70px;'>尺码</td>
                                                <?php $sizes=explode(',',$infos->size);?>
                                                @for($i=0;$i<count($sizes);$i++)
                                                    <td class="sits2" id="size">{{$sizes[$i]}}</td>
                                                @endfor
                                            @endif
                                            <td style="width:95px;" class="opeTit">操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @if(count($fabric_infos)>0)
                                            <?php $infos_num=1;?>
                                            @foreach($fabric_infos as $k => $v)
                                                @if($v->type=='other')
                                                    <tr>
                                                        <td>辅料</td>
                                                        <td>
                                                            <select class="sel_inp ips bigColor cloth_info2">
                                                                @if($v->other_info)
                                                                    <option value="{{$v->other_info}}">{{$v->other_info}}</option>
                                                                @endif
                                                                <option value="0">请选择</option>
                                                                @if(count($color_pro)>0)
                                                                    @for($i=0;$i<count($color_pro);$i++)
                                                                        <option value="{{$color_pro[$i]}}">{{$color_pro[$i]}}</option>
                                                                    @endfor
                                                                @endif
                                                            </select>
                                                        </td>

                                                        <td>
                                                            <input class="other_info2 form_inp ips codes coc{{$fabric_infos_num->other-$infos_num}}" abc="2" type="text" autocomplete="off" autocorrect="off" gg="{{$v->cloth_id}}"
                                                                   value="@if($v->other_info){{$v->cloth_info}}@endif">
                                                        </td>
                                                        <td>
                                                            <select class="sel_inp ips atla2 color_define_id2">
                                                                @if(count($v->fabric_color))
                                                                    <?php $or_color=explode(',',$v->color_ids);?>
                                                                    @if($v->color_id != 0)
                                                                        @for($i=0;$i<count($v->fabric_color);$i++)
                                                                            <option value="{{$or_color[$i]}}" @if($colors[$v->color_id]== $v->fabric_color[$i])selected @endif>{{$v->fabric_color[$i]}}</option>
                                                                        @endfor
                                                                    @endif
                                                                @endif
                                                                <option value="0">请选择</option>
                                                            </select>
                                                        </td>
                                                        <td>

                                                            <input class="cost_info2 form_inp ips" type="text" autocomplete="off" autocorrect="off" value="@if($v->cost!='0'){{$v->cost}}@endif">
                                                        </td>
                                                        <td>
                                                            <input class="door_info2 form_inp ips" type="text" autocomplete="off" autocorrect="off" value="@if($v->door!='0'){{$v->door}}@endif">
                                                        </td>
                                                        <td class="ttp2" abc="{{$fabric_infos_num->other-$infos_num}}">用量/米</td>
                                                        @if($v->remark)
                                                            <?php $size_=explode(',',$v->remark);?>
                                                            @for($i=0;$i<count($size_);$i++)
                                                                <td><input class="feis numCF recs{{$fabric_infos_num->other-$infos_num}}" type="text" value="{{$size_[$i]}}"></td>
                                                            @endfor
                                                        @endif
                                                        <td>
                                                            <a href="javascript:;" class="operateDe" abc="{{$v->id}}" def="1">删除</a>
                                                            <a href="javascript:;" class="copyTr" dd="2">复制</a>
                                                        </td>
                                                    </tr>
                                                    <?php $infos_num++;?>
                                                @endif
                                            @endforeach
                                        @endif
                                        </tbody>
                                    </table>
                                </div>
                                {{--工艺--}}
                                <div id="rates" class="tab-pane fabric_div">
                                    <table class="fabric Threegong" border="1" cellspacing="0" cellpadding="0">
                                        <thead>
                                        <tr>
                                            <td>颜色</td>
                                            <td>工艺名称</td>
                                            <td>标准工价</td>
                                            <td>单件工价</td>
                                            <td>操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @if(count($design_craft_cost)>0)
                                            @foreach($design_craft_cost as $k => $v)
                                                <tr>
                                                    <td>
                                                        <select class="sel_inp ips bigColor cloth_info3">
                                                            @if(count($color_pro)>0)
                                                                @for($i=0;$i<count($color_pro);$i++)
                                                                    <option value="{{$color_pro[$i]}}" @if($v->color==$color_pro[$i]) selected @endif>{{$color_pro[$i]}}</option>
                                                                @endfor
                                                            @endif
                                                        </select>
                                                    </td>
                                                    <td>
                                                        <select class="sel_inp ips cardInput">
                                                            @foreach($craft_infos as $kk => $vv)
                                                                <option value={{$vv->id}} @if($vv->craft_name==$v->craft_name) selected @endif >{{$vv->craft_name}}</option>
                                                            @endforeach
                                                            <option value="0">请选择</option>
                                                        </select>
                                                    </td>
                                                    <td>
                                                        <input class="form_inp ips norms feis" type="text" autocomplete="off" autocorrect="off" value="{{$v->standard_price}}">
                                                    </td>
                                                    <td>
                                                        <input class="form_inp ips singleton feis" type="text" autocomplete="off" autocorrect="off" value="{{$v->single_price}}">
                                                    </td>
                                                    <td>
                                                        <a href="javascript:;" class="operateDe" abc="{{$v->id}}" def="2">删除</a>
                                                    </td>
                                                </tr>
                                            @endforeach
                                        @endif
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group"><button type='button' class='save_add btn btn-success' abc="{{$infos->id}}">保存面料信息</button></div>
            </div>
        </div>
    </div>
    {{--弹框--}}
    <div class="info_box">
        <h3 style="text-align:center;position:relative;margin-bottom:20px;"><span class="infoAdd"></span><i class="fa fa-close chaL"></i></h3>
        <div class="form-group">
            <ul class="form_ul">
                <li class="form_li" style="width:auto;">关键词：<input class="form_inp fabric_num" type="text" autocomplete="off" autocorrect="off" placeholder="请输入关键词" /></li>
                <button type='button' class='btn btn-info souGo'>搜索</button>
            </ul>
        </div>
        <div class="form-group">
            <table class="gong">
                <thead><tr><td style="width:350px;">供应商</td><td>供应商货号</td></tr></thead>
                <tbody></tbody>
            </table>
        </div>
        <div class="form-group">
            <div class="page1" style="width:430px;margin:0 auto;"></div>
        </div>
    </div>
    <div class="mask" style="display:none;"></div>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/createBom.js?v=1.0.8"></script>
@endsection
